﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Patterns
{
    public class SinglePattern
    {
        private static object lockKey = new object();

        private static SinglePattern instance = null;
        public static SinglePattern Instance
        {
            get
            {
                if (instance == null)
                {
                    lock (lockKey)
                    {
                        if (instance == null)
                        {
                            instance = new SinglePattern();
                        }
                    }
                }
                return instance;
            }
        }

        private SinglePattern()
        { }

    }
}
